import http from '@/axios/http';

export function getGPT(params){
    return http.post('api/gpt/v1/chat', params)
}

//知识库分页
export function getKnowledge(params){
    return http.get('yswn/WnKnowledge/page', params)
}

//删除知识库
export function deleteKnowledge(params){
    return http.delete('yswn/WnKnowledge', params)
}

//上传文件
export function fileUpload(params){
    return http.post('sys/oss/upload', params)
}

//登陆
export function login(params){
    return http.post('login', params)
}

//人员分页
export function getStuff(params){
    return http.get('yswn/WnPerson/page', params)
}

//人员详情
export function getStuffInfo(id){
    return http.get(`yswn/WnPerson/${id}`)
}

//添加人员
export function addStuff(params){
    return http.post('yswn/WnPerson', params)
}

//编辑人员
export function editStuff(id, params){
    return http.put(`yswn/WnPerson/${id}`, params)
}

//人员导出
export function exportStuff() {
    return http.get(`yswn/WnPerson/export`, false, true)
}

//删除人员
export function deleteStuff(params){
    return http.delete(`yswn/WnPerson`, params)
}

//事件类型分页
export function getEventTypePage(params){
    return http.get(`yswn/WnEventType/page`, params)
}

//查询所有事件类型(下拉)
export function getEventType(){
    return http.get(`yswn/WnEventType/list`)
}

//删除事件
export function deleteEvent(params){
    return http.delete(`yswn/WnEventType`, params)
}

//字典数据
export function getDicts(){
    return http.get(`sys/dict/type/all`)
}

//事件分页
export function getEventPage(params){
    return http.get(`yswn/WnEvent/page`, params)
}

//设备位置列表
export function getDevicePosition(params){
    return http.get(`yswn/WnDevicePosition/list`, params)
}

//添加设备
export function addDevice(params){
    return http.post('yswn/WnDevice', params)
}

//设备管理分页
export function getDevicePage(params){
    return http.get(`yswn/WnDevice/page`, params)
}

//删除设备
export function deleteDevice(params){
    return http.delete(`yswn/WnDevice`, params)
}

//设备位置统计
export function deviceStatistics(params){
    return http.get(`yswn/WnDevicePosition/deviceStatistics`, params)
}

//设备位置分页
export function devicePositionPage(params){
    return http.get(`yswn/WnDevicePosition/page`, params)
}

//添加设备位置
export function addDevicePosition(params){
    return http.post('yswn/WnDevicePosition', params)
}

//删除设备位置
export function deleteDevicePosition(params){
    return http.delete(`yswn/WnDevicePosition`, params)
}

//设备状态统计
export function deviceStatusStatistics(params){
    return http.get(`overview/deviceStatusStatistics`, params)
}

//学习统计
export function studyStatistics(params){
    return http.get(`overview/studyStatistics`, params)
}

//事件类型
export function eventTypeList(params){
    return http.get(`overview/eventTypeList`, params)
}

//预警视频分页
export function getVideoPage(params){
    return http.get(`yswn/WnVideo/page`, params)
}

//添加事件
export function addEvent(params){
    return http.post('yswn/WnEventType', params)
}


//ai趋势分析，最近7天
export function aiAnalysis(params){
    return http.get('analysis/eventScoreAnalysis', params)
}

// 最近的日报
export function lastDailyReport(params){
    return http.get('overview/lastDailyReport', params)
}

// 最近的周报
export function lastWeeklyReport(params){
    return http.get('overview/lastWeeklyReport', params)
}

// 最近ai处置
export function lastDisposal(params){
    return http.get('analysis/lastDisposal', params)
}

// 本周最严重
export function weeklyMostSeriousEvent(params){
    return http.get('overview/weeklyMostSeriousEvent', params)
}


// 违规类型统计
export function eventTypeStatistics(params){
    return http.get('analysis/eventTypeStatistics', params)
}

// 一周事件统计
export function weekEventStatistics(params){
    return http.get('overview/weekEventStatistics', params)
}

// 严重程度统计
export function eventLevelStatistics(params){
    return http.get('analysis/eventLevelStatistics', params)
}


//设置大屏名称
export function setScreenName(params){
    return http.post('overview/setScreenName', params)
}

//设置直播流地址
export function setLiveStreamUrl(params){
    return http.post('overview/setLiveStreamUrl', params)
}

//公告分页
export function announcementPage(params){
    return http.get(`yswn/WnAnnouncement/page`, params)
}

//添加公告
export function addAnnouncement(params){
    return http.post('yswn/WnAnnouncement', params)
}

//删除公告
export function deleteAnnouncement(params){
    return http.delete(`yswn/WnAnnouncement`, params)
}

//企业列表分页
export function companyPage(params){
    return http.get(`sys/wnCompany/page`, params)
}

//删除企业
export function deleteCompany(params){
    return http.delete(`sys/wnCompany`, params)
}

//企业信息
export function companyInfo(id){
    return http.get(`sys/wnCompany/${id}`)
}

// 获取大屏名称
export function getScreenName(params){
    return http.get(`overview/getScreenName`, params)
}

//登出
export function logout(params){
    return http.post(`logout`, params)
}

// 查询直播地址
export function getLiveStreamUrl(params){
    return http.get(`overview/getLiveStreamUrl`, params)
}

//添加企业
export function addCompany(params){
    return http.post('sys/wnCompany', params)
}

//编辑企业
export function editCompany(id, params){
    return http.put(`sys/wnCompany/${id}`, params)
}

//获取AI平台列表
export function getAiPlatformList(params){
    return http.get(`sys/common/getAiPlatformList`, params)
}

//查询模型列表，含企业关联
export function companyModels(params){
    return http.get(`sys/wnModel/companyModels`, params)
}

//apiKey列表分页
export function getSysWnApikey(params){
    return http.get(`sys/SysWnApikey/page`, params)
}

//删除apiKey
export function deleteSysWnApikey(params){
    return http.delete(`sys/SysWnApikey`, params)
}

// 公告查询
export function wnAnnouncement(params){
    return http.get(`yswn/WnAnnouncement/page`, params)
}

//企业用户管理分页
export function companyUserPage(params){
    return http.post(`sys/companyUser/page`, params)
}

//删除企业用户
export function deleteCompanyUser(params){
    return http.delete(`sys/companyUser`, params)
}

//添加企业用户
export function addCompanyUser(params){
    return http.post('sys/companyUser', params)
}

//编辑企业用户
export function editCompanyUserInfo(id, params){
    return http.put(`sys/companyUser/${id}`, params)
}

//查询企业用户
export function getCompanyUserInfo(id){
    return http.get(`sys/companyUser/${id}`)
}

//编辑密码
export function editPwd(params){
    return http.put(`sys/user/password`, params)
}

//重置密码
export function resetPwd(id){
    return http.put(`sys/companyUser/resetPassword/${id}`)
}

// ai
export function chatRegister(){
    return http.post(`chat/register`)
}

export function getAiPlatformConf(params){
    return http.get(`sys/common/getAiPlatformConf`, params)
}
